package com.citywy.controller;

import com.citywy.domain.Items;
import com.citywy.service.ItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/items")
public class ItemsController {
    @Autowired
    private ItemsService itemsService;

    /**
     * 查询详情
     * @param model
     * @return
     */
    @RequestMapping("findDetail")
    public String findDetail(Model model){
        System.out.println("进来了...");
        Items items = itemsService.findById(1);
        model.addAttribute("item",items);
        return "pages/itemDetail";
    }
}
